//
// Created by ta&to on 2022/9/14.
//
#include "httpserver.h"

void inittask(thread_pool_t *tpt){
    Thread_Pool_Init(tpt);
    tpt->initthreads = 15;
    tpt->maxthreads = 10000;
    tpt->minthreads = 10;
    Thread_Pool_Commit(tpt);
    Thread_Pool_Monitor(tpt);
}

void initlog(thread_pool_t *tpt,log_t *logt){
    log_init(logt);
    Thread_Task_Post(tpt, http_log_cycle, logt);
}

void doMain(thread_pool_t *tpt, log_t *logt) {
    http_socket_event_t hset = { NULL };
    http_socket_event_handle_t handler;
    struct http_global_data_event_func_container hgdefc;
    hset.hgdefc = &hgdefc;
    hset.hgdefc->temp_func_handler = &handler;
    conn_init(tpt, logt, &hset,  ___socket_r_callback, NULL);
    http_init(tpt, logt, &hset);
}